package com.zzedu.enmuns;

import java.util.Arrays;

/**
 * 班级类型
 */
public enum ClzzTypeEnums {

    /**
     * 常规班
     */
    ROUTINE(1, "常规班"),

    /**
     * 特殊班
     */
    SPECIAL(2, "特殊班"),
    ;


    private final int code;

    private final String desc;

    ClzzTypeEnums(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static ClzzTypeEnums getCode(int code) {
        return Arrays.stream(ClzzTypeEnums.values()).filter(e -> e.getCode() == code).findFirst().orElse(null);
    }
}
